<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title></title><link href="__TMPL__Static/Css/style.css" rel="stylesheet" /><script type="text/javascript" src="__TMPL__Static/Js/jquery.js"></script><script type="text/javascript" src="__TMPL__Static/Js/base.js"></script><script type="text/javascript" src="__TMPL__Static/Js/json.js"></script><script type="text/javascript" src="__TMPL__Static/Js/jquery.pngFix.js"></script><link href="__TMPL__Static/Css/tooltip.css" rel="stylesheet" /><script type="text/javascript" src="__TMPL__Static/Js/jquery.tooltip.js"></script><script type="text/javascript"><!--
//指定当前组模块URL地址 
var URL = '__URL__';
var ROOT_PATH = '__ROOT__';
var APP	 =	 '__APP__';
var STATIC = '__TMPL__Static';
var VAR_MODULE = '<?php echo c('VAR_MODULE');?>';
var VAR_ACTION = '<?php echo c('VAR_ACTION');?>';
var CURR_MODULE = '<?php echo ($module_name); ?>';
var CURR_ACTION = '<?php echo ($action_name); ?>';

//定义JS中使用的语言变量
var CONFIRM_DELETE = '<?php echo (L("CONFIRM_DELETE")); ?>';
var AJAX_LOADING = '<?php echo (L("AJAX_LOADING")); ?>';
var AJAX_ERROR = '<?php echo (L("AJAX_ERROR")); ?>';
var ALREADY_REMOVE = '<?php echo (L("ALREADY_REMOVE")); ?>';
var SEARCH_LOADING = '<?php echo (L("SEARCH_LOADING")); ?>';
var CLICK_EDIT_CONTENT = '<?php echo (L("CLICK_EDIT_CONTENT")); ?>';
//--></script></head><body><div class="fanwe-body"><div class="fb-title"><div><p><span><?php echo ($ur_href); ?></span></p></div></div><div class="fb-body"><table class="body-table" cellpadding="0" cellspacing="1" border="0"><tr><td class="body-table-td"><div class="body-table-div"><script type="text/javascript" src="__TMPL__Static/Js/dataList.js"></script><div class="handle-btns"><div class="img-button "><p><input type="button" id="editData" name="editData" value="<?php echo (L("EDIT")); ?>" onclick="editData(this,'checkList')" class="editData"></p></div><div class="img-button "><p><input type="button" id="removeGoods" name="removeGoods" value="<?php echo (L("REMOVE")); ?>" onclick="removeGoods(this,'checkList')" class="removeGoods"></p></div><div class="img-button "><p><input type="button" id="disableGoods" name="disableGoods" value="<?php echo (L("DISABLE")); ?>" onclick="disableGoods(this,'checkList')" class="disableGoods"></p></div><form action="__APP__"><span><?php echo (L("KEYID")); ?></span><input class="textinput" type="text" value="<?php echo ($keyid); ?>" name="keyid" size="10" /><small></small><span><?php echo (L("NAME")); ?></span><input class="textinput" type="text" value="<?php echo ($keyword); ?>" name="keyword" size="10" /><small></small><span><?php echo (L("COLOR")); ?></span><select name="color"><option value="0"><?php echo (L("COLOR_ALL")); ?></option><?php if(is_array($color_list)): foreach($color_list as $key=>$color_item): ?><option value="<?php echo ($color_item["id"]); ?>" <?php if($color == $color_item['id']): ?>selected="selected"<?php endif; ?> ><?php echo ($color_item["name"]); ?></option><?php endforeach; endif; ?></select><small></small><span><?php echo (L("CATE_NAME")); ?></span><select name="cate_id"><option value="0" <?php if($cate_id == 0): ?>selected="selected"<?php endif; ?> ><?php echo (L("GOODS_ALL")); ?></option><option value="-1" <?php if($cate_id == -1): ?>selected="selected"<?php endif; ?> ><?php echo (L("NO_CATEGORY")); ?></option><?php if(is_array($cate_list)): foreach($cate_list as $key=>$cate_item): ?><option value="<?php echo ($cate_item["cate_id"]); ?>" <?php if($cate_id == $cate_item['cate_id']): ?>selected="selected"<?php endif; ?> ><?php echo ($cate_item["cate_name"]); ?></option><?php endforeach; endif; ?></select><input class="submit_btn" type="submit" value="<?php echo (L("SEARCH")); ?>" /><input type="hidden" name="<?php echo c('VAR_MODULE');?>" value="<?php echo ($module_name); ?>" /><input type="hidden" name="<?php echo c('VAR_ACTION');?>" value="index" /></form></div><!-- Think 系统列表组件开始 --><table id="checkList" class="table-list list" cellpadding="0" cellspacing="0" border="0"><thead><tr><th width="30" class="first"><input type="checkbox" onclick="checkAll('checkList')"></th><th width="160" ><a href="javascript:sortBy('keyid','<?php echo ($sort); ?>','zdm')" title="按照<?php echo (L("KEYID")); echo ($sortType); ?> "><?php echo (L("KEYID")); if(($order) == "keyid"): ?><img src="__TMPL__Static/Images/<?php echo ($sortImg); ?>.gif" align="absmiddle"><?php endif; ?></a></th><th width="50" ><a href="javascript:sortBy('img_id','<?php echo ($sort); ?>','zdm')" title="按照<?php echo (L("IMG_ID")); echo ($sortType); ?> "><?php echo (L("IMG_ID")); if(($order) == "img_id"): ?><img src="__TMPL__Static/Images/<?php echo ($sortImg); ?>.gif" align="absmiddle"><?php endif; ?></a></th><th width="80" ><?php echo (L("CATE_NAME")); ?></th><th width="60" ><a href="javascript:sortBy('color_name','<?php echo ($sort); ?>','zdm')" title="按照<?php echo (L("COLOR")); echo ($sortType); ?> "><?php echo (L("COLOR")); if(($order) == "color_name"): ?><img src="__TMPL__Static/Images/<?php echo ($sortImg); ?>.gif" align="absmiddle"><?php endif; ?></a></th><th ><?php echo (L("NAME")); ?></th><th width="80" ><?php echo (L("PRICE")); ?></th><th width="160">操作</th></tr></thead><tbody><?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$item): $mod = ($i % 2 );++$i;?><tr ="<?php echo ($item[""]); ?>" class="<?php if(($mod) == "0"): ?>even<?php endif; ?>"><td class="first"><input type="checkbox" name="key"	value="<?php echo ($item["id"]); ?>"></td><td ><?php echo ($item["keyid"]); ?></td><td ><?php echo (gettooltipimg($item["img_id"])); ?></td><td ><?php echo ($item["cate_name"]); ?></td><td ><?php echo ($item["color_name"]); ?></td><td align="left" ><?php echo (getgoodsnamelink($item["name"],$item['url'])); ?></td><td ><?php echo ($item["price"]); ?></td><td><a href="javascript:;" onclick="disableGoods(this,'<?php echo ($item["id"]); ?>','id')"><?php echo (L("DISABLE")); ?></a>&nbsp;&nbsp;<a href="javascript:;" onclick="editData(this,'<?php echo ($item["id"]); ?>','id')"><?php echo (L("EDIT")); ?></a>&nbsp;&nbsp;<a href="javascript:;" onclick="removeGoods(this,'<?php echo ($item["id"]); ?>','id')"><?php echo (L("REMOVE")); ?></a>&nbsp;&nbsp;</td></tr><?php endforeach; endif; else: echo "" ;endif; ?></tbody></table><!-- Think 系统列表组件结束 --><div class="pager"><?php echo ($page); ?></div><script type="text/javascript">var CONFIRM_HANDLER = "<?php echo (L("CONFIRM_HANDLER")); ?>";
function disableGoods(obj,id,pk,args)
{
	removeDisableGoods(obj,id,1);
}

function removeGoods(obj,id,pk,args)
{
	removeDisableGoods(obj,id,0);
}

function removeDisableGoods(obj,id,type)
{
	var ids =  new Array();
	if(isNaN(id))
	{
		$("#" + id + " input:checked[name='key']").each(function(){
			ids.push(this.value);
		});
	}
	else
	{
		ids.push(id);
		var parent = $(obj).parent().parent();
		id = parent.parent().parent().attr('id');
	}
	
	ids = ids.join(',');
	if(ids == '')
		return false;
	
	if(!window.confirm(CONFIRM_HANDLER))
		return false;
		
	var fun = function(){
		if(type == 1)
			location.href = APP + '?' + VAR_MODULE + '=' + CURR_MODULE + '&' + VAR_ACTION + '=disable&id=' + ids;
		else
			location.href = APP + '?' + VAR_MODULE + '=' + CURR_MODULE + '&' + VAR_ACTION + '=remove&id=' + ids;
	}
	setTimeout(fun,1);
}
</script></div></td></tr></table></div></div><div class="ajax-loading"></div></body><script type="text/javascript">jQuery(function($){
	updateBodyDivHeight();
	$(window).resize(function(){
		updateBodyDivHeight();
	});
	$('.imgTooltip').poshytip();
});

function updateBodyDivHeight()
{
	jQuery(".body-table-div").height(jQuery(".fanwe-body").height() - 36);
	if(jQuery(".body-table-div").get(0).scrollHeight > jQuery(".body-table-div").height())
	{
		var width = jQuery(".body-table-div").width() - 16;
		jQuery(".body-table-div > *").each(function(){
			if(!$(this).hasClass('ajax-loading'))
			{
				$(this).width(width)	
			}
		});
	}
}
</script></html>